//
//  YWBaseEmptyDataSetViewController.m
//  maintain
//
//  Created by 郑想 on 15/10/28.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWBaseEmptyDataSetViewController.h"
#import "UIScrollView+EmptyDataSet.h"
#import "YWMacro.h"

@interface YWBaseEmptyDataSetViewController () <DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>

@end

@implementation YWBaseEmptyDataSetViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
}
#pragma mark - DZNEmptyDataSetSource Methods
- (NSAttributedString*)titleForEmptyDataSet:(UIScrollView*)scrollView
{
    NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];

    [attributes setObject:[UIFont fontWithName:@"HelveticaNeue-Light" size:17.0] forKey:NSFontAttributeName];
    [attributes setObject:YWColor(44, 44, 44) forKey:NSForegroundColorAttributeName];
    return [[NSAttributedString alloc] initWithString:[self showTitle] attributes:attributes];
}

- (UIImage*)imageForEmptyDataSet:(UIScrollView*)scrollView
{
    return [UIImage imageNamed:@"placeholder_empty"];
}

//- (UIColor*)backgroundColorForEmptyDataSet:(UIScrollView*)scrollView
//{
//    return [UIColor whiteColor];
//}

#pragma mark - DZNEmptyDataSetSource Methods
- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView*)scrollView
{
    return YES;
}

#pragma mark - Common methods
- (NSString*)showTitle
{
    NSString* title = @"暂时没有相关信息";
    //    NSString* className = NSStringFromClass([self class]);
    //    if ([className isEqualToString:@"YWEquipmentBaseInfoVC"]) {
    //        title = @"暂无设备基础信息";
    //    }
    //    else if ([className isEqualToString:@"YWTroubleRecordVC"]) {
    //        title = @"暂无维修记录";
    //    }
    //    else if ([className isEqualToString:@"YWPropertyCompanyVC"]) {
    //        title = @"暂无物业信息";
    //    }
    //    else if ([className isEqualToString:@"YWManufacturerViewController"]) {
    //        title = @"暂无设备厂家信息";
    //    }

    return title;
}
@end
